import { RouteRecordRaw } from 'vue-router'

type MessageTypes = 'success' | 'info' | 'warning' | 'error'
type MessageTypesName = '成功' | '提示' | '警告' | '错误'

export type Confirm = (massage: string, callback: () => void, type?: MessageTypes, title?: string) => void
export type Notification = (message: string, title?: MessageTypesName, type?: MessageTypes) => void
export type Message = (message: string, type?: MessageTypes) => void
export type FilterRoutes = (routes: RouteRecordRaw[]) => Array<RouteRecordRaw>

export interface LoginCanvasType {
  clear: () => void
  startAnima: () => void
  closeAnima: () => void
}

export type ModuleTypes = {
  filterRoutes: FilterRoutes
  confirm: Confirm
  loginCanvas: LoginCanvasType
  message: Message
  notification: Notification
}
